Skip to content

✨[Feat] Sprint 3 TIFF and EXIF Core - #4

Merged
maruson08 merged 4 commits into
mainfrom
feat/sprint-3-tiff-exif-core
Aug 24, 2026
Merged

✨[Feat] Sprint 3 TIFF and EXIF Core#4
maruson08 merged 4 commits into
mainfrom
feat/sprint-3-tiff-exif-core

Conversation

@maruson08

Copy link
Copy Markdown
Member

Summary

  • add a shared JPEG-independent TIFF/EXIF decoder over bounded TIFF-only views
  • validate II/MM byte order, magic 42, first IFD offsets, complete IFD tables, and inline versus offset values
  • support BYTE, ASCII, SHORT, LONG, RATIONAL, UNDEFINED, SLONG, and SRATIONAL
  • traverse IFD0, ExifIFD, GPSIFD, and next-IFD links through an iterative FIFO queue
  • enforce per-IFD entry, depth, total work, value-size, and decoded-component limits
  • reject cyclic/repeated IFD offsets and recover around individual invalid entries
  • decode a small common IFD0/ExifIFD/GPS tag set with exact rational values
  • preserve duplicate and unknown tags structurally; keep MakerNote opaque
  • integrate decoded child entries and relocated source paths/diagnostics into JPEG EXIF inspection

Diagnostics

TIFF_TRUNCATED_HEADER, TIFF_INVALID_BYTE_ORDER, TIFF_INVALID_MAGIC, TIFF_INVALID_FIRST_IFD_OFFSET, TIFF_TRUNCATED_IFD, TIFF_IFD_ENTRY_LIMIT_EXCEEDED, TIFF_IFD_DEPTH_LIMIT_EXCEEDED, TIFF_TRAVERSAL_LIMIT_EXCEEDED, TIFF_CYCLIC_IFD, TIFF_UNSUPPORTED_FIELD_TYPE, TIFF_INVALID_VALUE_RANGE, TIFF_INVALID_VALUE_OFFSET, TIFF_INVALID_POINTER, and TIFF_INVALID_RATIONAL.

Tests

  • 16 test files, 155 tests passed
  • little- and big-endian headers, empty IFDs, inline SHORT/BYTE/count-two values, and offset ASCII
  • exact RATIONAL/SRATIONAL, zero denominators, unsigned LONG maximum, and signed LONG minimum
  • ExifIFD and common GPS traversal, including big-endian GPS
  • cycles, depth, per-IFD and total-work limits, truncated tables, invalid pointers/offsets, unsupported types, and extreme counts
  • duplicates, unknown tags, opaque MakerNote, JPEG TIFF-base offsets, exact subviews, determinism, and input preservation

Deferred

No MakerNote or thumbnail decoding, arbitrary vendor tags, XMP/IPTC/ICC payload parsing, PNG/WebP integration, rewriting, cleaning, verification, decompression, image decoding, fuzzing, Rust, or WASM is included.

Validation

  • npm run format:check — passed
  • npm run lint — passed
  • npm run typecheck — passed
  • npm test — 16 files, 155 tests passed
  • npm run build — ESM, source map, and declarations built
  • npm audit — 0 vulnerabilities
  • npm ls --omit=dev --depth=0 — 0 runtime dependencies
  • npm pack --dry-run — expected 7-file, 30.1 kB package payload

Security review

All TIFF reads use the bounded reader. TIFF offsets remain relative to the TIFF subview. Complete IFD tables are validated before iteration; count multiplication is checked; traversal is iterative, depth/entry/total-work bounded, and cycle protected. No payload copies, input mutation, native bounds control flow, or runtime network/filesystem/DOM dependency was introduced.

@maruson08
maruson08 merged commit 2fd70ab into main Aug 24, 2026
1 check passed
@maruson08
maruson08 deleted the feat/sprint-3-tiff-exif-core branch August 24, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant